#include <stdio.h>
#include <stdlib.h>

  int main(){

    int op;
    float v0, v1, t;
    printf ("########################################################################\n");
    printf ("###                   xcal v0.1 beta by: phellipe_                   ###\n");
    printf ("########################################################################\n");
    printf ("[1]=> +\n[2]=> -\n[3]=> x\n[4]=> /\n[0]=> Sair\n");
    do{
      printf ("Operação: ");
      scanf("%d", &op);
      
      if(op == 1){
        printf ("v1: ");
        scanf("%f", &v0);
        printf ("v2: ");
        scanf("%f", &v1);
        t = v0 + v1;
        printf ("Result: %.2f\n", t);

      }
      else if(op == 2){
        printf ("v1: ");
        scanf("%f", &v0);
        printf ("v2: ");
        scanf("%f", &v1);
        t = v0 - v1;
        printf ("Result: %.2f\n", t);

      }
      else if(op == 3){
        printf ("v1: ");
        scanf("%f", &v0);
        printf ("v2: ");
        scanf("%f", &v1);
        t = v0 * v1;
        printf ("Result: %.2f\n", t);
      }
      else if(op == 4){
        printf ("v1: ");
        scanf("%f", &v0);
        printf ("v2: ");
        scanf("%f", &v1);
        t = v0 / v1;
        printf ("Result: %.2f\n", t);
      }
      else if(op == 0){
        printf ("OK\n");
        exit(0);

      }
      else{
        printf ("???\n");

      }


    }
    while(op != 0);


  return 0;
}
